<?php
// +----------------------------------------------------------------------
// | QSCMS
// +----------------------------------------------------------------------
// | Copyright (c)  2025 https://www.qqss.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed QSCMS is not free software, commercial use must purchase official license from official website to avoid unnecessary legal disputes.
// +----------------------------------------------------------------------
// | Author: Contract 990504246@qq.com
// +----------------------------------------------------------------------

namespace app\common\model;

use think\Model;

class ChannelAccount extends Model
{
  public function channel()
  {
    return $this->belongsTo('Channel');
  }

  protected function setParamsAttr($value)
  {
    return json_encode($value);
  }

  protected function getParamsAttr($value)
  {
    return json_decode($value);
  }

  public function orders()
  {
    return $this->hasMany('Order', 'channel_account_id');
  }
}
